import ACCESS_ENUM from './accessEnum'

/**
 * 页面权限配置
 * 可以在这里统一配置每个页面所需的权限
 */
export const PAGE_ACCESS_CONFIG = {
  // 公开页面（无需权限）
  '/': null,
  '/user/login': null,
  '/user/register': null,
  '/about': null,
  '/picture/:id': null,
  '/space/:id': null,
  '/search_picture': null,
  '/noauth': null,
  
  // 需要登录的页面
  '/user/profile': ACCESS_ENUM.USER,
  '/add_picture': ACCESS_ENUM.USER,
  '/add_picture/batch': ACCESS_ENUM.USER,
  '/add_space': ACCESS_ENUM.USER,
  '/my_space': ACCESS_ENUM.USER,
  '/space_analyze': ACCESS_ENUM.USER,
  '/user_exchange_vip': ACCESS_ENUM.USER,
  
  // 管理员页面
  '/admin/userManage': ACCESS_ENUM.ADMIN,
  '/admin/pictureManage': ACCESS_ENUM.ADMIN,
  '/admin/spaceManage': ACCESS_ENUM.ADMIN,
  '/spaceUserManage/:id': ACCESS_ENUM.ADMIN,
}

/**
 * 菜单权限配置
 * 配置导航菜单中每个菜单项所需的权限
 */
export const MENU_ACCESS_CONFIG = [
  {
    key: '/',
    label: '主页',
    access: null,
  },
  {
    key: '/add_picture',
    label: '创建图片',
    access: ACCESS_ENUM.USER,
  },
  {
    key: '/admin/userManage',
    label: '用户管理',
    access: ACCESS_ENUM.ADMIN,
  },
  {
    key: '/admin/pictureManage',
    label: '图片管理',
    access: ACCESS_ENUM.ADMIN,
  },
  {
    key: '/admin/spaceManage',
    label: '空间管理',
    access: ACCESS_ENUM.ADMIN,
  },
]
